package com.tyut.service.Impl;

import com.tyut.mapper.UserMapper;
import com.tyut.pojo.User;
import com.tyut.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    public User selectByUsername(String username){
        return userMapper.selectByUsername(username);
    }

    @Override
    public int deleteUser(String username) {
        int i = userMapper.deleteUser(username);
        return i;
    }

    @Override
    public int insertUser(User user) {
        int i = userMapper.insert(user);
        return i;
    }

    @Override
    public int updateUser(User user) {
        int i = userMapper.updateUser(user);
        return i;
    }

    @Override
    public User selectByUsername(User user) {
        User user1 = userMapper.selectUser(user);
        return user1;
    }

    public User findUserByName(String user) {
        User user1 = userMapper.findUserByName(user);
        return user1;
    }
}
